local jingnan = fk.CreateSkill {
  name = "lingling__jingnan",
  tags = { Skill.Wake },
}

Fk:loadTranslationTable {
  ["lingling__jingnan"] = "靖难",
  [":lingling__jingnan"] = "觉醒技，准备阶段，若你的”图“不少于三张，你摸两张牌并回复1点体力，获得技能“焚志”。",

  ["$lingling__jingnan_lingling__zhudi1"] = "过家家的游戏就到此为止了！",
  ["$lingling__jingnan_lingling__zhudi2"] = "过家家的游戏就到此为止了！"
}

jingnan:addEffect(fk.EventPhaseStart, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(jingnan.name) and player.phase == Player.Start and
        player:usedSkillTimes(jingnan.name, Player.HistoryGame) == 0
  end,
  can_wake = function(self, event, target, player, data)
    return #player:getPile("lingling__zhudi_tu") >= 3
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if player.dead then return end
    player:drawCards(2, jingnan.name)
    if player.dead then return end
    room:recover {
      who = player,
      num = 1,
      recoverBy = player,
      skillName = jingnan.name,
    }
    room:handleAddLoseSkills(player, "lingling__fenzhi_zhudi")
  end,
})

return jingnan
